import React from "react";

import 'antd/dist/antd.css';
import { Button } from 'antd';

class Btn extends React.Component{
    constructor(props) {
        super(props);
        // this.props.step;
        // this.props.toFather;
        this.clickHandler = this.clickHandler.bind(this)
    }
    clickHandler(){
        this.props.toFather(this.props.step)
    }
    render() {
        let text = ""
        if (this.props.step === -1) text = "重新开始"
        else text = "回到第" + this.props.step + "步";
        return (
            <div>
                <Button type="primary" onClick={this.clickHandler}>{text}</Button>
            </div>
        )
    }
}

export default Btn;